<template>
  <div>
    <el-table
      @row-click="tableclick"
      :header-cell-style="{ backgroundColor: '#f6f4fc' }"
      :data="b_tableData.list"
      style="width: 100%"
    >
      <el-table-column prop="company_name" label="企业名称" width="300">
        <template slot-scope="scope">
          <span class="text_one">
            {{ scope.row.company_name }}
          </span>
          <!-- <span class="item_list item_demand2" v-if="scope.row.label == 1">
            未走访
          </span> -->
          <span class="item_list item_demand2" v-if="scope.row.label == 2">
            已走访
          </span>
          <!-- <span class="item_list item_demand2" v-if="scope.row.label == 3">
            90天未走访
          </span>
          <span class="item_list item_demand2" v-if="scope.row.label == 4">
            180天未走访
          </span> -->
        </template>
      </el-table-column>
      <el-table-column prop="num2" :label="b_tableData.date[1] + '年专利数量'">
      </el-table-column>
      <el-table-column prop="num1" :label="b_tableData.date[0] + '年专利数量'">
      </el-table-column>
      
    </el-table>
  </div>
</template>

<script>
import { visitDetailtwo } from "@/api/newuser.js";
export default {
  components: {},
  props: {
    b_tableData: {
      type: Object,
      default: function () {
        return {
          list: [],
          date: [],
        };
      },
    },
  },
  data() {
    return {};
  },
  mounted() {
    // console.log(this.b_tableData);
  },
  methods: {
    tableclick(row) {
      // console.log(row);
      this.$router.push({
        path: "/workEnterprisevisit",
        query: {
          company_id: row.company_id,
          company_name: row.company_name,
        },
      });

      //判断是否有走访记录
      // visitDetailtwo({
      //   company_id: row.company_id
      // }).then(res => {
      //   // console.log(res);
      //   if (res.list.length == 0) {
      //     this.$router.push(
      //       {
      //         path: '/addWaitvisit',
      //         query: {
      //           company_name: row.company_name,
      //           company_id: row.company_id,
      //         }
      //       }
      //     )
      //   } else {
      //     this.$router.push({
      //       path: '/workEnterprisevisit',
      //       query: {
      //         company_id: row.company_id,
      //       }
      //     })
      //   }
      // })
    },
  },
};
</script>

<style scoped lang="less">
.item_list {
  display: inline-block;
  background-color: #d3e2ff;
  margin: 0px 5px;
  border-radius: 5px;
  padding: 0px 5px;
  color: #387dff;
  font-weight: initial;
  font-size: 10px;
}

.item_demand2 {
  background-color: #fff6f5;
  font-size: 14px;
  color: #ff5f58;
  border: 1px solid #ff5f58;
}

@media (max-width: 1360px) {
}

@media (max-width: 1280px) {
}
</style>
